package com.ftqh.project.travel.security.repository;

import com.ftqh.project.travel.security.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.query.Param;

import javax.transaction.Transactional;
import java.util.Optional;

/**
 * Created by Administrator on 2017/3/29.
 */
@Transactional
public interface UserRepository extends JpaRepository<User, Long>,JpaSpecificationExecutor<User> {

    Optional<User> findByUsername(@Param("username") String username);

    Optional<User> findByPhone(@Param("phone") String phone);
}
